function delCartOnPages(a) {
    $.ajax({
        url: "/cart/delCart",
        dataType: "json",
        data: {"cartId": a.name},
        async: false,
        success: function (data) {
            if (data["result"] == "ok") {
                layer.msg('删除成功', {time: 1000}, function () {
                    window.location.reload();
                    var count = data["count"];
                    if(count<=0){
                        $("#tips").html("  <div style=\"text-align: center;font-size: 14px;\">您还没有添加商品哦~</div>");
                        $("#cartCountExist").html('0');
                    }
                });
            } else if (data["result"] == "fail") {
                layer.msg('删除失败', {time: 1000}, function () {
                    window.location.reload();
                });
            } else if (data["result"] == "noSession") {
                layer.msg('登录失效，请重新登录', {time: 1000}, function () {
                    window.location = "login";
                });
            } else {
                layer.msg('系统错误', {time: 1000}, function () {
                    window.location.reload();
                });
            }
        },
        type: "post"
    });
}

